From: Giovanni Campagna Date: Mon, 20 Dec 2010 16:58:12 +0000 (+0100) Subject: BluetoothStatus: hide the additional separator if no devices are shown X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9371 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=054f49820183befaafc6544ba650b235fb3ed44a;p=gnome-shell.git BluetoothStatus: hide the additional separator if no devices are shown Sometimes devices are reported by BluetoothApplet, but are not shown, so we should not count them to decide whether to show the device separator. --- diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index ead3b1f88..bde3f46cf 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -124,18 +124,20 @@ Indicator.prototype = { this._deviceItems = []; let devices = this._applet.get_devices(); - if (devices.length == 0) - this._deviceSep.actor.hide(); - else - this._deviceSep.actor.show(); + let anydevice = false; for (let i = 0; i < devices.length; i++) { let d = devices[i]; let item = this._createDeviceItem(d); if (item) { this.menu.addMenuItem(item, this._deviceItemPosition + this._deviceItems.length); this._deviceItems.push(item); + anydevice = true; } } + if (anydevice) + this._deviceSep.actor.show(); + else + this._deviceSep.actor.hide(); }, _createDeviceItem: function(device) {